package com.wanxi.array;

import java.util.ArrayList;
import java.util.Scanner;

public class DeleteArray {
    public static void main(String[] args) {
        ArrayList<Student> arrayList = new ArrayList<>();

        Scanner scanner = new Scanner(System.in);
//        for (int i = 0; i < 5; i++) {
//            System.out.println("请输入第" + (i + 1) + "个学生姓名");
//            String name = scanner.next();
////            scanner.nextLine();
//            System.out.println("请输入第" + (i + 1) + "个学生年龄");
//            int age = scanner.nextInt();
//            arrayList.add(new Student(name, age));
//        }
        arrayList.add(new Student("1", 22));
        arrayList.add(new Student("2", 16));
        arrayList.add(new Student("3", 19));
        arrayList.add(new Student("4", 23));
        arrayList.add(new Student("5", 26));
//        arrayList.remove(2);
//        arrayList.remove(new Student("3", 22));
//        for (int i = 0; i < arrayList.size(); i++) {
//            if (arrayList.get(i).getName().equals("3")) {
//                arrayList.remove(arrayList.get(i));
//            }
//        }
//        Student aaa = arrayList.set(0, new Student("aaa", 22));
//        System.out.println(aaa);
        System.out.println(arrayList);
    }
}
